<?php

defined('APPLICATION_PATH')
or define('APPLICATION_PATH', dirname(__FILE__));

$config = new Zend_Config_Ini(APPLICATION_PATH . '/config/application.ini', 'general');
$config->setReadOnly();

$dbAdapter = Zend_Db::factory($config->db);
Zend_Registry::set('db',$dbAdapter);
Zend_Db_Table_Abstract::setDefaultAdapter($dbAdapter);
//echo APPLICATION_PATH;exit;
$frontController = Zend_Controller_Front::getInstance();
$frontController->setControllerDirectory(APPLICATION_PATH . '/controllers')
    			->throwExceptions(true);
				
$view = new Zend_View();
$view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper');
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
$viewRenderer->setView($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);

Zend_Layout::startMvc();

/*$route = $frontController->getRouter();

$route->addRoute('projects',
    new Zend_Controller_Router_Route('projects',
        array(
            'controller' => 'index',
            'action'     => 'projects'
        )
    )
);*/